package flink.api_study.calculate;

import flink.api_study.source.Person;
import flink.api_study.source.PersonSource;
import org.apache.flink.streaming.api.datastream.DataStream;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;

public class MaxTest {
    public static void main(String[] args) throws Exception{
        final StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
        DataStream<Person> stream = env.addSource(new PersonSource());

        stream.keyBy(person -> person.getJob())
                .maxBy("age")
                .print();
        env.execute();
    }



}
